package servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import domain.DAOContact;
import domain.DAOPhoneNumber;

/**
 * Servlet implementation class NewContact
 */
public class NewContact extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public NewContact() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		String firstName = request.getParameter("firstName");
		String lastName = request.getParameter("lastName");
		String email = request.getParameter("email");
		long id = Long.parseLong(request.getParameter("id"));
		String street = request.getParameter("street");
		String city = request.getParameter("city");
		String zip = request.getParameter("zip");
		String country = request.getParameter("country");
		String homePhone = request.getParameter("homePhone");
		String cellPhone = request.getParameter("cellPhone");
		String officePhone = request.getParameter("officePhone");
//		First Name 	: 	
//			Last Name 	: 	
//			Email 	: 	
//			ID 	: 	
//			Street 	: 	
//			City 	: 	
//			Zip Code 	: 	
//			Country 	: 	
//			Home Phone 	: 	
//			Cell Phone 	: 	
//			Office Phone 	: 	
//		int id = Integer.parseInt(request.getParameter("id"));
//		String email = request.getParameter("email");
		
		DAOContact daoContact = new DAOContact();
		daoContact.addContact(
								firstName, 
								lastName, 
								email, 
								street, 
								city, 
								zip, 
								country, 
								homePhone, 
								cellPhone, 
								officePhone);
		
	}

}
